<?php


namespace App\Http\Requests\ApiV2;

use Illuminate\Support\Facades\Auth;

class CommentRequest extends BaseRequest
{
    public function rules()
    {
        return [
            'content' => 'required|min:6',
        ];
    }

    public function messages()
    {
        return [
            'content.required' => __('请输入评论'),
            'content.min' => __('评论内容不能少于:count个字', ['count' => 6]),
        ];
    }

    public function filldata()
    {
        return [
            'content' => strip_tags(clean($this->post('content'))),
            'reply_id' => $this->input('reply_id', 0),
            'parent_id' => $this->input('parent_id', 0),
            'user_id'=>Auth::id(),

        ];
    }
}
